﻿using SmartHotel.DAL;
using SmartHotel.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartHotel.BLL
{
    public class JiFenBLL
    {
        public JiFenBLL(JifenDAL jifenDAL)
        {
            JifenDAL = jifenDAL;
        }

        public JifenDAL JifenDAL { get; }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="jiFen"></param>
        /// <returns></returns>
        public int Add(JiFen jiFen)
        {            
            return JifenDAL.Add(jiFen);
        }



        public MyPage<JiFen> GetJifenPages(int index, int size, out int count) {
            var data = JifenDAL.GetJifenPages(index, size, out count);//调用DAL层的分页查询方法
            MyPage<JiFen> myPage = new MyPage<JiFen>();//初始化MyPage类,分别给Count Data  Size 赋值
            myPage.Count = count;
            myPage.Data = data;
            myPage.Size = size;
            return myPage;//返回赋好值的对象
        }

       
    }
}
